<template>
    <!-- // 5GMR结构指标-小区(天) -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="startTime" label="时间" min-width="200">
                <template #default="scope">
                    {{ scope.row.startTime ? formatDateNormal(scope.row.startTime) : null }}
                </template>
            </el-table-column>
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="areaType" label="区域" min-width="200" />
            <el-table-column prop="cellName" label="小区名称" min-width="200" />
            <el-table-column prop="vendorName" label="所属厂家" min-width="200" />
            <el-table-column prop="workband" label="频段" min-width="200" />
            <el-table-column prop="arfcn" label="中心频点" min-width="200" />
            <el-table-column prop="coverageType" label="覆盖类型" min-width="200" />
            <el-table-column prop="longitude" label="经度" min-width="200" />
            <el-table-column prop="latitude" label="纬度" min-width="200" />
            <el-table-column prop="mroTotal" label="总采样点" min-width="200" />
            <el-table-column prop="mroOverlapTotal" label="重叠覆盖采样点" min-width="200" />
            <el-table-column prop="mroOverlapRate" label="重叠覆盖度" min-width="200" />
            <el-table-column prop="diff6DbOverlapNrscTotal" label="小区作为邻区时的干扰采样点总数" min-width="200" />
            <el-table-column prop="usefulSignalRate" label="有用信号占比" min-width="200" />
            <el-table-column prop="nrSinrAvg" label="下行SINR平均值" min-width="200" />
            <el-table-column prop="nrSinrLP3" label="下行SINR＜3db采样点数" min-width="200" />
            <el-table-column prop="nrSinrLP3Rate" label="下行SINR＜3db采样点占比" min-width="200" />
            <el-table-column prop="nrSinrL0" label="下行SINR＜0db采样点数" min-width="200" />
            <el-table-column prop="nrSinrL0Rate" label="下行SINR＜0db采样点占比" min-width="200" />
            <el-table-column prop="nrSinrLN3" label="下行SINR＜-3db采样点数" min-width="200" />
            <el-table-column prop="nrSinrLN3Rate" label="下行SINR＜-3db采样点占比" min-width="200" />
            <el-table-column prop="nrRsrpAvg" label="RSRP平均值" min-width="200" />
            <el-table-column prop="nrRsrpH110" label="RSRP采样点数(≥-110dbm)" min-width="200" />
            <el-table-column prop="nrRsrpH110Rate" label="RSRP覆盖率(≥-110dbm)" min-width="200" />
            <el-table-column prop="phyUlMeanNlPrb" label="干扰均值" min-width="200" />
            <el-table-column prop="cityId" label="地市编号" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get5GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getMR5gStructureList, params);
    tableData.value = tableData.value.data;
    loading.value = false;

    mittBus.emit("setIndexFlag", false)
}

getData(props.rowsData);
</script>